<template>
  <a-modal
    title="复制版本"
    :width="800"
    :visible="visible"
    :confirmLoading="false"
    :closable="false"
    :cancelButtonProps="{ style: { visibility: 'hidden' }}"
    @ok="() => { $emit('ok', {version, year}) }"
    @cancel="() => { $emit('cancel') }">
    <a-spin :spinning="false">
      <a-form layout="inline">
        <a-row :gutter="24">
          <a-col
            :md="12">
            <a-form-item label="选择年份">
              <a-select
                show-search
                :style="{width: '200px'}"
                v-model="year"
                placeholder="请选选择年份">
                <a-select-option
                  v-for="i in years"
                  :key="i">
                  {{ i }}
                </a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
          <a-col
            :md="10">
            <a-form-item label="选择版本">
              <a-select
                show-search
                :style="{width: '200px'}"
                v-model="version"
                placeholder="请选择版本">
                <a-select-option
                  v-for="i in versions"
                  :key="i">
                  {{ i }}
                </a-select-option>
              </a-select>
            </a-form-item>
          </a-col>
        </a-row>
      </a-form>
    </a-spin>
  </a-modal>
</template>

<script>
export default {
  props: {
    visible: {
      type: Boolean,
      required: true
    },
    years: {
      type: Array,
      default: () => []
    },
    versions: {
      type: Array,
      default: () => []
    }
  },
  components: {

  },
  data () {
    return {
      version: undefined,
      year: undefined
    }
  },
  created () {},
  watch: {
  },

  methods: {

  }
}
</script>
<style lang="less" scoped>
/deep/.ant-input-number {
  width: fit-content;
}
</style>
